package number4;

public class printA_Z extends Thread{
	public static final Object lock = new Object();

    @Override
    public void run() {
        for (char letter = 'A'; letter <= 'Z'; letter++) {
            synchronized (lock) {
                try {
                    lock.wait();
                    System.out.print(letter+" ");
                    lock.notify();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
